# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-witnessme
_pkgname=WitnessMe
pkgver=1.5.0
pkgrel=8
epoch=1
pkgdesc='Web Inventory tool, takes screenshots of webpages using Pyppeteer.'
arch=('any')
groups=('blackarch' 'blackarch-webapp' 'blackarch-recon')
url='https://pypi.org/project/witnessme/#files'
license=('GPL3')
depends=('python' 'python-aiosqlite' 'python-appdirs' 'python-imgcat'
         'python-prompt_toolkit' 'python-pyee' 'python-pyppeteer'
         'python-yaml' 'python-six' 'python-terminaltables' 'python-tqdm'
         'python-urllib3' 'python-wcwidth' 'python-websockets'
         'python-xmltodict' 'python-aiodns' 'python-lxml')
makedepends=('python-setuptools')
replaces=('witnessme')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('7e9a4959f7770cb1d3ae0c9730ffc128dae5f9e8984d1c60b73cba13080dc22ca26dde53ae50021223fa91bd7012bbc7219a24632554b5b1e4f42cddb36f9bea')

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

